#include <stdio.h>
#include <stdlib.h>

int add_cmp(const void* e1, const void* e2)
{
    return **(int**)e1 - **(int**)e2;
}

void solve(int n, int arr[])
{
    double sum = 0;
    for(int j = 0; j < n; j++)
    {
        sum += (double)arr[j];
    }
    sum = sum*2/n;
    if(sum == (int)sum)
    {
        int** add = (int**)malloc(sizeof(int*) * n);
        int* ret = (int*)malloc(sizeof(int) * n);
        for(int i = 0; i < n; i++)
        {
            add[i] = &arr[i];
        }
        qsort(add, n, sizeof(int*), add_cmp);
        for(int i = 0, j = n-1; i <= j; i++, j--)
        {
            if(*add[i] + *add[j] != sum)
            {
                printf("%d\n", -1);
                return;
            }
            else
            {
                int e1 = add[i] - arr;
                int e2 = add[j] - arr;
                ret[e1] = e2 + 1;
                ret[e2] = e1 + 1;
            }
        }
        for(int i = 0; i < n; i++)
        {
            printf("%d ", ret[i]);
        }
        printf("\n");
        free(add);
        free(ret);
    }
    else
    printf("%d\n", -1);
}

int main()
{
    int n = 0, k = 0;
    k = scanf("%d", &n);
    int* arr = (int*)malloc(sizeof(int) * n);
    for(int i = 0; i < n; i++)
    {
        k = scanf("%d", &arr[i]);
    }
    solve(n, arr);
    free(arr);
    return 0;
}